<template>
	<view class="content">
		<uni-popup ref="popup1" type="dialog">
			<uni-popup-dialog title="登录失败,请重试" :before-close="true" @close="loginRetry"
				@confirm="loginRetry"></uni-popup-dialog>
		</uni-popup>
		<view class="notfound" v-if="notFound">
			<image src="@/static/ic_no_page.png" mode="heightFix" class="ic"></image>
			<text class="remark">找不到页面</text>
		</view>
	</view>

</template>

<script>
	import cfg from '@/utils/config.js'
	import loginUtil from '@/utils/login_util.js'
	export default {
		data() {
			return {
				notFound: false,
				
				fromType: ''
			}
		},
		onLoad(param) {
			console.log('index param: ' + JSON.stringify(param))
			let from = param.from
			// let from = 'qyrecept'
			// let from = 'qyvisited'
			// let from = 'qyreg'
			// let from = 'qygate'
			// let from = 'qymeeting'
			// let from = 'qyremote'
			this.fromType = from
			
			let target = cfg.target[from]
			if (!target) {
				this.notFound = true
				return;
			} else {
				loginUtil.loginRefresh(this.fromType, this.onLoginError)
			}
		},
		methods: {
			onLoginError() {
				this.$refs.popup1.open()
			},
			loginRetry(e) {
				this.$refs.popup1.close()
				loginUtil.loginRefresh(this.fromType, this.onLoginError)
			},
		}
	}
</script>

<style lang="scss">
	.content {
		height: 100vh;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.notfound {
		display: flex;
		flex-direction: column;
		align-items: center;

		.ic {
			height: 220rpx;
		}

		.remark {
			font-size: 28rpx;
			margin-top: 40rpx;
		}
	}
</style>